home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / intersectCurveToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.4 KB  |  121 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  14 January 1999
  22. // Author:         sw
  23. //
  24. //
  25. //  Procedure Name:
  26. //      intersectCurveToolScript
  27. //
  28. //  Description:
  29. //    create wrapper around the intersectCurve command
  30. //
  31. //  Input Arguments:
  32. //        0 ==> do the command.
  33. //        1 ==> show the action option box
  34. //        2 ==> return the command
  35. //        3 ==> show tool option box
  36. //        4 ==> enter the tool
  37. //
  38. //  Return Value:
  39. //      None.
  40. //
  41.  
  42. global proc intersectCurveToolSetup( int $forceFactorySettings, string $goToTool )
  43. {
  44.     if( $forceFactorySettings || !`optionVar -ex intersectCurveEuc` ) {
  45.         optionVar -iv intersectCurveEuc 1;
  46.     }
  47.     if( $forceFactorySettings || !`optionVar -ex intersectCurveLac` ) {
  48.         optionVar -iv intersectCurveLac 0;
  49.     }
  50.     if( "" != $goToTool ) {
  51.         scriptCtx -e -euc `optionVar -q intersectCurveEuc` $goToTool;
  52.         scriptCtx -e -lac `optionVar -q intersectCurveLac` $goToTool;
  53.     }
  54. }
  55.  
  56. global proc intersectCurveValues ( string $toolName ) 
  57. {
  58.     performIntersectCrv 3 $toolName;
  59.     scriptCtxCommonValues( $toolName );
  60. }
  61.  
  62. global proc intersectCurveProperties()
  63. {
  64.     scriptCtxCommonProperties;
  65. }
  66.  
  67. proc createIntersectCurveContext( string $tool )
  68. {
  69.     if( ! `scriptCtx -exists $tool` ) {
  70.         intersectCurveToolSetup( 0, "" );
  71.         int $n = 0;
  72.         if( `optionVar -q intersectCurveLac` ) {
  73.             $n = 2;
  74.         }
  75.         scriptCtx -i1 "intersectCurves.xpm"
  76.             -title "Intersect Curves Tool"
  77.             -bcn "intersectCurve"
  78.  
  79.             -exitUponCompletion `optionVar -q intersectCurveEuc`
  80.             -totalSelectionSets 1
  81.             -expandSelectionList true
  82.             -fcs ("intersectCurveToolScript 0")
  83.  
  84.             -setNoSelectionPrompt ("Select two NURBS curves or points on " +
  85.                                    "curves for intersecting.")
  86.             -setSelectionPrompt ("Select the second NURBS curve or a point " +
  87.                                  "on a NURBS curve to intersect." +
  88.                                  "Press ENTER to complete.")
  89.  
  90.             -setAutoToggleSelection true
  91.             -setAutoComplete `optionVar -q intersectCurveLac`
  92.             -showManipulators true
  93.             -setSelectionCount $n
  94.  
  95.             -nurbsCurve true
  96.         $tool;
  97.     }
  98. }
  99.  
  100. global proc string intersectCurveToolScript( int $setToTool )
  101. //
  102. //    Description :
  103. //        0 ==> do the command.
  104. //        1 ==> show the action option box
  105. //        2 ==> return the command
  106. //        3 ==> show tool/action option box
  107. //        4 ==> enter the tool/do the command
  108. {
  109.     string $tool = "";
  110.     if( $setToTool > 2 ) {
  111.         if( !`optionVar -q modelWithToolIntersectCurve` ) {
  112.             $setToTool = 4 - $setToTool;
  113.         }
  114.         else {
  115.             $tool = "intersectCurveContext";
  116.             createIntersectCurveContext $tool;
  117.         }
  118.     }
  119.     return scriptToolScript( "performIntersectCrv", $setToTool, $tool );
  120. }
  121.